<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Insert title here</title>
</head>
<body>
<input type="button" value="获取菜单" id="btn">
</body>
<script type="text/javascript" src="/javaTree/web/jquery.min.js"></script>
<script type="text/javascript">

    $("#btn").click(function () {
        $.ajax({
            type: "get",
            url: "menu.do",
            dataType: "json",
            success: function (obj) {
                if (obj.state == 1) {
                    var menus = obj.data;
                    console.log(menus);
                    for (var i = 0; i < menus.length; i++) {
                        alert("1");
                    }
                } else {
                    alert("请求失败");
                }

            }
        });
    })


</script>
</html>